# -*- coding: utf-8 -*-

import requests


class Category:

    def mobile_get(self, http_url, app_key):
        params = {
            'key': app_key
        }
        response = requests.get(url=http_url, params=params)
        if response.status_code == 200:
            print(response.json())
            return response.json()
        else:
            print('接口数据异常')
            return None


if __name__ == '__main__':
    http_url = 'http://apis.juhe.cn/rubbish/category'
    app_key = 'f191d0b4d9a332be0288c4fab8b28836'
    ca = Category()
    ca.mobile_get(http_url, app_key)
